import 'package:flutter/material.dart';

import 'msg_cell.dart';

class ConversationCell extends StatelessWidget {
  final int msgType;
  const ConversationCell({Key? key, required this.msgType}) : super(key: key);

  Widget _createChild(BuildContext context) {
    switch (msgType) {
      case 1:
        return MsgTextContentView(
          lastTime: 1643731200000,
          isReverse: false,
          // onTapHead: () => _onTapHead(context, msg),
          // onResendMsg: () => _onResendMsg(context, msg),
        );
      case 3:
        return MsgImageContentView(
          lastTime: 1643731200000,
          imUid: "imUid",
          isReverse: false,
          // onTapMsg: () => _onTapMsg(context, msg),
          // onTapHead: () => _onTapHead(context, msg),
          // onResendMsg: () => _onResendMsg(context, msg),
        );
      case 11:
        return MsgSystemView(msg: "msg.textElem!.text!");
      default:
        return MsgTextContentView(
          lastTime: 1643731200000,
          isReverse: false,
          // onTapHead: () => _onTapHead(context, msg),
          // onResendMsg: () => _onResendMsg(context, msg),
        );
    }
  }

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.only(left: 16, right: 16, bottom: 16),
      child: _createChild(context),
    );
  }
}
